package com.inspectortime.service;

import java.util.Iterator;
import java.util.List;

import junit.framework.TestCase;

public class SaxZipCodeSearchServiceImplTestOld extends TestCase {

	
	public void testLookupZip() throws Exception {
		ZipCodeInfo info = service.lookupZipCode("30341");
		assertTrue(info.getStateCode().equals("GA"));
	}
	
	ZipCodeSearchService service = new SaxZipCodeSearchServiceImpl();
		
	public void testNearbyZipSearch500() throws Exception {		
		List list = service.findNearbyZipCodes("30341", 99);
		Iterator iter = list.iterator();
		ZipCodeInfo originalZip = (ZipCodeInfo) iter.next();
		assertEquals("30341", originalZip.getZipCode());
		assertEquals(0.0, originalZip.getOptionalDistanceToSource());
		assertEquals(33.89010238647461, originalZip.getLatitude());
		ZipCodeInfo nextZip = (ZipCodeInfo) iter.next();
		assertEquals("30340", nextZip.getZipCode());
	}
	
	public void testNearbyZipSearchInvalidZip() throws Exception {		
		List list = service.findNearbyZipCodes("00001", 99);
	}
	
	/*
	public void testMany() throws Exception {
		for (int i = 0; i < 10; i++) {
			testNearbyZipSearch500();
		}
	}
	*/
}
